package pl.com.sjap.wizualizator;

import javax.swing.ImageIcon;
import javax.swing.JLabel;

public class Agent {
	
	private String name;
	private int x;
	private int y;
	private String message;
	private ImageIcon imageIcon;
	private String pathToImage;
	private JLabel image;
	
	public Agent(String name, int x, int y, String pathToImage) {
		super();
		this.name = name;
		this.x = x;
		this.y = y;
		this.pathToImage = pathToImage;
		imageIcon = new ImageIcon(this.pathToImage);
		image = new JLabel();
		image.setBounds(x, y, 40, 30);
		image.setIcon(imageIcon);
		
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getX() {
		return x;
	}


	public int getY() {
		return y;
	}
	
	public void setPosition(int x, int y){
		this.x=x;
		this.y=y;
		image.setBounds(this.x, this.y, 40, 30);
	}
	
	public void przesun(int x, int y){
		this.x+=x;
		this.y+=y;
		image.setBounds(this.x, this.y, 40, 30);
	}
	public void przesun(int[]  przesuniecie){
		this.x+=przesuniecie[0];
		this.y+=przesuniecie[1];
		image.setBounds(this.x, this.y, 40, 30);
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String getPathToImage() {
		return pathToImage;
	}

	public void setPathToImage(String pathToImage) {
		this.pathToImage = pathToImage;
		imageIcon = new ImageIcon(this.pathToImage);
		image.setIcon(imageIcon);
	}

	public JLabel getImage() {
		return image;
	}

	public void setImage(JLabel image) {
		this.image = image;
	}
	
	

}
